{% extends 'layout.html ' %}

{% block content %}

<div>
    <div class="container">
        <div style="margin-bottom: 10px" calss="clearfix" >
            <a class="btn btn-primary" href="/sub_dep/add/">添加次科室</a>
            <!--查询-->
            <div style="float:right;width:300px;">
                <form method="get">
                    <div class="input-group">
                        <!--                        搜索框-->
                        <input type="text" name="search" class="form-control" placeholder="Search for..."
                               value="{{ search_data }}">
                        <span class="input-group-btn">
                           <button class="btn btn-default" type="submit">
                               <span class="glyphicon glyphicon-search" aria-hidden="true"></span>
                           </button>
                        </span>
                    </div>
                </form>
            </div>

            <div class="panel panel-default">

                <div class="panel-heading">
                    <span class="glyphicon glyphicon-th" aria-hidden="true"></span>
                    次科室管理表
                </div>

                <table class="table table-bordered">
                    <thead>
                    <tr>
                        <th>次科室编号</th>
                        <th>次科室名称</th>
                        <th>主科室名称</th>
                        <th>操作</th>
                    </tr>
                    </thead>

                    <tbody>
                    {% for obj in queryset %}
                    <tr>
                        <th>{{ obj.sub_dep_id }}</th>
                        <th>{{ obj.sub_dep_name }}</th>
                        <th>{{ obj.main_dep}}</th>
                        <th>
                            <a class="btn btn-success btn-xs" href="/sub_dep/{{obj.sub_dep_id }}/edit/">编辑</a>
                            <a class="btn btn-danger btn-xs" href="/sub_dep/{{ obj.sub_dep_id }}/delete/">删除</a>
                        </th>
                    </tr>
                    {% endfor %}
                    </tbody>
                </table>
            </div>
            <!--            页码-->
            <div class="clearfix">
                <ul class="pagination" style="float:left;">
                    {{ page_string }}
                </ul>
            </div>
        </div>
        {% endblock %}